A CFG is in Chomsky Norm Form (CNF) if every of its rules is of three forms
Conflict conditions:(all of the conflicts can be transformed)
Push-down automata: A PDA is 6-tuple
PDA 不好表示空栈,故可以使用字符 $ 进行标记
for
A language is context-free if and only if it is accpeted by some PDA.
Given
Let
Assume if is CFL
Let
By pumping theorem,
(3) -> at most one of a or c do apprear in v and y
(2) ->
Contradicts with (1)
使用类似 滑动窗口 的方法,设置窗口大小为 p,在枚举的字符串中滑动,并穷举所有的情况。